var form = layui.form;
//监听提交
form.on('submit(submitform)', function (data) {
    console.log(data)
    var $form = $(data.form);
    
    var submitData = data.field;
    var url = $form.attr('action');
    var type = $form.attr('method');
    
    $.ajax({
        url: url,
        dataType: 'json',
        data: submitData,
        type: type,
        success: function(res) {
            console.log(res);
        },
        error: function(err) {
            console.log(err)
        }
    });
    return false;
});